package com.service.weChatWifiLogin.enums;

import org.springframework.util.StringUtils;

public enum ReviewStatusEnum {

    SITE_DEVICE(0,"待审核"),
    APP_TRAFFIC (1,"审核中"),
    ONLINE(2,"审核失败"),
    TRAFFIC(3,"审核成功"),
    TERMINAL_USER(4,"下发成功"),
    SITE_HEALTH(5,"已回退");

    private Integer code;
    private String description;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    private ReviewStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static ReviewStatusEnum get(Integer code){
        if (StringUtils.hasLength(String.valueOf(code))) {
            for (ReviewStatusEnum element : ReviewStatusEnum.values()) {
                if (element.getCode().equals(code)) {
                    return element;
                }
            }
        }
        return null;
    }

}
